﻿<?php 
    global $customer_id;
    $folders_query = tep_db_query("select folders from ushop_templates where default_templates = 1");
    $folders = tep_db_fetch_array($folders_query);
    $folders = substr($folders['folders'], 3); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html $htmlparams xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<!--$headcontent-->
    <link href="<?php echo $folders; ?>css/layout.css" type="text/css" rel="Stylesheet" />    
    <script src="<?php echo $folders; ?>js/jqzoom/js/jquery-1.6.js" type="text/javascript"></script>  
    <script type="text/javascript" src="templates/phuocndt/js/jquery-1.4.2.js"></script>
<script src="<?php echo $folders; ?>js/jqzoom/js/jquery.jqzoom-core.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo $folders; ?>js/jqzoom/css/jquery.jqzoom.css" type="text/css">
 
 
    <script type="text/javascript" src="<?php echo $folders; ?>js/jquery.easing.min.js"></script>
    <script type="text/javascript" src="<?php echo $folders; ?>js/jquery.lavalamp.min.js"></script>
    <script type="text/javascript" src="<?php echo $folders; ?>js/jquery.validate.js"></script>
    
    <script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
    
    <link rel="stylesheet" type="text/css" href="<?php echo $folders; ?>css/superfish.css" media="screen">
	<link rel="stylesheet" type="text/css" href="<?php echo $folders; ?>css/superfish-vertical.css" media="screen">
    <script type="text/javascript" src="<?php echo $folders; ?>js/hoverIntent.js"></script>
    <script type="text/javascript" src="<?php echo $folders; ?>js/superfish.js"></script> 
    <script type="text/javascript" src="jquery-tooltip/js/easyTooltip.js"></script>
    
   
     <script type="text/javascript">
        $(function() {
        	$('.neoslideshow img:gt(0)').hide();
        	setInterval(function(){
              $('.neoslideshow :first-child').fadeOut()
                 .next('img').fadeIn()
                 .end().appendTo('.neoslideshow');}, 
              4000);
        })
</script>
<style type="text/css">
.neoslideshow {position:relative; width:500px; height:260px;}
.neoslideshow img {position:absolute;left:0; top:0;border-radius: 5px 5px 5px 5px;}
</style>
    <script type="text/javascript">
        function onFocus() {
            var t = document.getElementById("searchtxt").value;
            if (t == "Nhập từ khóa muốn tìm")
                document.getElementById("searchtxt").value = "";
        }
        function onBlur() {
            var t = document.getElementById("searchtxt").value;
            if (t == "")
                document.getElementById("searchtxt").value = "Nhập từ khóa muốn tìm";
        }

        //window.attachEvent("onload", correctPNG);
        
        jQuery(document).ready(function($){
           jQuery(function() {
                jQuery("#hmenu").lavaLamp({
                    fx: "backout",
                    speed: 700
                });
            });
            
           $("a#link").easyTooltip({
    			useElement: "item"				   
    		})
                                                
           
           jQuery("#hmenu li").click(function(){
               jQuery(this).toggleClass("current");            
           });
           
           $(".detail-panel").hide();

            $("#p1").show();

            $("#t1").click(function() {
                $("#p2").hide('slow');
                $("#p1").show('slow');
                $("#t1").addClass('current');
                $("#t2").removeClass('current');
            });
            $("#t2").click(function() {
                $("#p1").hide('slow');
                $("#p2").show('slow');
                $("#t1").removeClass('current');
                $("#t2").addClass('current');
            });
            $(".detail-preview-original").hide();
            
            $("#v1").show();
            $("#pre1").click(function() {
                $(".detail-preview-original").hide();
                $("#v1").fadeIn('slow');
            });
            $("#pre2").click(function() {
                $(".detail-preview-original").hide();
                $("#v2").fadeIn('slow');
            });
            $("#pre3").click(function() {
                $(".detail-preview-original").hide();
                $("#v3").fadeIn('slow');
            });
             
           jQuery("#checkout").click(function(event){
                window.location.href = 'checkout_shipping.php';             
           });           
           
           jQuery("#contactform").validate({
                rules: {
                  c_name:{
                    required: true
                  },
                  c_email:{
                    required: true,
                    email: true
                  },  
                  c_phone: {
                    required: true,
                    number:true
                  },
                  c_yahoo:{
                    required: true
                  },
                  c_title: {
                    required: true             
                  },
                  c_des: {
                    required: true
                  }
                },
                messages: {
                  c_des: "Vui lòng nhập vào nội dung."
                }
            });           
                        
            //submenu
			$('ul.sf-menu').superfish();			
			//fix leftmenu too long
			var lm = $(".leftmenu").height();
			var hc = $(".home-content").height();			
			if(lm > hc){
				$(".home-content").css("height", lm+160);
                //var hb = $(".home-bot").height();
                //$(".home-bot").css("margin-bottom", (lm - 770) + "px");
				//$(".home-bot").css("margin-bottom", (lm - hc + hb + 40) + "px");
			}
            
            	jQuery('.jqzoom').jqzoom({
            zoomType: 'standard',
            lens:true,
            preloadImages: false,
            alwaysOn:false
        });
        $("a#example1").fancybox();
         });
    </script>
    <script type="text/javascript" src="<?php echo $folders; ?>js/jquery.tools.min.js"></script>
    <script type="text/javascript" src="<?php echo $folders; ?>js/pngfix.js"></script>
    
    <script type="text/javascript" src="carousel/scripts/yahoo.js"></script> 
	<script type="text/javascript" src="carousel/scripts/carousel.js"></script>

<!--	<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/reset-fonts-grids/reset-fonts-grids.css&2.6.0/build/base/base-min.css">-->
	<link href="carousel/css/carousel.css" rel="stylesheet" type="text/css">
	<link href="carousel/css/yui.css" rel="stylesheet" type="text/css">
<!-- 
	Inlined styles for my overrides to the carousel for this demo.
	Normally I would put this in a separate CSS file.
-->
<style type="text/css">
.carousel-component { 
	padding:8px 16px 4px 16px;
	margin:0px;
    margin-left:32px;
    height:167px;
}

.carousel-component .carousel-list li { 
	margin:4px;
	width:116px; /* img width is 75 px from flickr + a.border-left (1) + a.border-right(1) + 
	               img.border-left (1) + img.border-right (1)*/
	height:166px; /* image + row of text (87) + border-top (1) + border-bottom(1) + margin-bottom(4) */
	/*	margin-left: auto;*/ /* for testing IE auto issue */
}

.carousel-component .carousel-list li a { 
	display:block;
	border:1px solid #e2edfa;
	outline:none;
}

.carousel-component .carousel-list li a:hover { 
	border: 1px solid #aaaaaa; 
}

.carousel-component .carousel-list li img { 
	border:1px solid #999;
	display:block; 
}
								
.carousel-component .carousel-prev { 
	position:absolute;
	top:74px;
	z-index:3;
	cursor:pointer; 
	left:5px; 
}

.carousel-component .carousel-next { 
	position:absolute;
	top:74px;
	z-index:3;
	cursor:pointer; 
	right:5px; 
}
</style>

<script type="text/javascript">

/**
 * Custom button state handler for enabling/disabling button state. 
 * Called when the carousel has determined that the previous button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: prevButtonStateHandler
 **/
var handlePrevButtonState = function(type, args) {

	var enabling = args[0];
	var leftImage = args[1];
	if(enabling) {
		leftImage.src = "carousel/images/left-enabled.gif";	
	} else {
		leftImage.src = "carousel/images/left-disabled.gif";	
	}
	
};

/**
 * Custom button state handler for enabling/disabling button state. 
 * Called when the carousel has determined that the next button
 * state should be changed.
 * Specified to the carousel as the configuration
 * parameter: nextButtonStateHandler
 **/
var handleNextButtonState = function(type, args) {

	var enabling = args[0];
	var rightImage = args[1];
	
	if(enabling) {
		rightImage.src = "carousel/images/right-enabled.gif";
	} else {
		rightImage.src = "carousel/images/right-disabled.gif";
	}
	
};


/**
 * You must create the carousel after the page is loaded since it is
 * dependent on an HTML element (in this case 'mycarousel'.) See the
 * HTML code below.
 **/
var carousel; // for ease of debugging; globals generally not a good idea
var pageLoad = function() 
{
	carousel = new YAHOO.extension.Carousel("mycarousel", 
		{
			numVisible:       5,
			animationSpeed:    0.15,
			scrollInc:         3,
			navMargin:         20,
			prevElement:     "prev-arrow",
			nextElement:     "next-arrow",
			size:              19,
			prevButtonStateHandler:   handlePrevButtonState,
			nextButtonStateHandler:   handleNextButtonState
		}
	);

};

YAHOO.util.Event.addListener(window, 'load', pageLoad);

</script>

</head>
<body>

<!-- Cai dat XFBML -->
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: '150375571655788', status: false, cookie: true, xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
<!-- Ket thuc cai dat XFBML -->

<div align="center">
    <div class="allwrapper">
        <div class="headerbg"></div>
        <div class="header">
            <?php include DIR_WS_INCLUDES.'load_wid/top.php'; ?>           
            
            <ul class="lavaLampWithImage" id="hmenu">
            <?php $menu = $_SERVER['REQUEST_URI'];
            $menu_news = preg_match('/products_new.php$/', $menu);
            $menu_specials = preg_match('/products_specials.php$/', $menu);
            $menu_helps = preg_match('/helps/', $menu);
            $menu_contacts = preg_match('/contacts.php$/', $menu);
            $menu_orders_product = preg_match('/orders_product.php$/', $menu);
                if($menu_news){
            ?>
                <li class="current"><a href="index.php">Trang chủ</a></li>
            <?php }else{ ?>
                <li><a href="index.php">Trang chủ</a></li>
            <?php } ?>
            <?php if($menu_specials){ ?>
                <li class="current"><a href="products_specials.php">&nbsp;&nbsp;Khuyến mãi</a></li>
            <?php }else{ ?>
                <li><a href="products_specials.php">&nbsp;&nbsp;Khuyến mãi</a></li>
            <?php } ?>
            <?php if($menu_helps){ ?>
                <li class="current"><a href="helps.php">&nbsp;&nbsp;Trợ giúp</a></li>
            <?php }else{ ?>
                <li><a href="helps.php">&nbsp;&nbsp;Trợ giúp</a></li>
            <?php } ?>
            <?php if($menu_contacts){ ?>
                <li class="current"><a href="contacts.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Liên hệ</a></li>
            <?php }else{ ?>
                <li><a href="contacts.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Liên hệ</a></li>
            <?php } ?>
            <?php if($menu_orders_product){ ?>   
                <li class="current"><a href="orders_product.php">&nbsp;&nbsp;Đặt hàng Mỹ</a></li>
            <?php }else{ ?>
                <li><a href="orders_product.php">&nbsp;&nbsp;Đặt hàng Mỹ</a></li>
            <?php } ?>
            </ul>
            
            <?php include DIR_WS_INCLUDES.'load_wid/welcome.php'; ?>
            <?php include DIR_WS_INCLUDES.'load_wid/search.php'; ?>
        </div>
        <div class="body">
            <div class="leftmenu">
                <?php include DIR_WS_INCLUDES.'load_wid/left.php'; ?>
                
                <div class="lmbot"></div>
                <div class="flower"></div>
            </div>
            <?php
            $images_query = tep_db_query("select * from slideshow_images where published =1 order by order_ asc");
            
            ?>
            <div class="home-content">                
                <div class="home-top">
                 <div class="neoslideshow">
                 <?php while($image = tep_db_fetch_array($images_query)){ ?>
                      <img onclick="location.href='<?php echo $image['link'] ?>'" style="cursor: pointer;" src="images/<?php echo 'slideshow_'.$image['image'] ?>" width="723" height="220" />
                <?php } ?>
                    
                    </div>
 
                </div>
                <?php //include DIR_WS_INCLUDES.'load_wid/google.php'; ?>
                <?php $cPath = $_REQUEST['cPath'];
                    if($cPath != ''){
                ?>
                <div class="toy-top">                    
                    <?php include DIR_WS_INCLUDES.'load_wid/breadcrumbs.php'; ?>
                    <?php include DIR_WS_INCLUDES.'load_wid/cartbox.php'; ?>                    
                </div>
                <?php
                    }
                ?>
                <div class="home-mid">
                    $content                                       
                </div>
                
                <div class="home-bot"></div>               
            </div>
            <div class="footer">
                <ul class="footernav">
                    <?php
                        if($menu_news){
                    ?>
                        <li class="current"><a href="products_new.php">Hàng mới</a></li>
                    <?php }else{ ?>
                        <li><a href="products_new.php">Hàng mới</a></li>
                    <?php } ?>
                    <?php if($menu_specials){ ?>
                        <li class="current"><a href="products_specials.php">Khuyến mãi</a></li>
                    <?php }else{ ?>
                        <li><a href="products_specials.php">Khuyến mãi</a></li>
                    <?php } ?>
                    <?php if($menu_helps){ ?>
                        <li class="current"><a href="helps.php">Trợ giúp</a></li>
                    <?php }else{ ?>
                        <li><a href="helps.php">Trợ giúp</a></li>
                    <?php } ?>
                    <?php if($menu_contacts){ ?>
                        <li class="current"><a href="contacts.php">Liên hệ</a></li>
                    <?php }else{ ?>
                        <li><a href="contacts.php">Liên hệ</a></li>
                    <?php } ?>
                    <?php if($menu_orders_product){ ?>   
                        <li class="current"><a href="orders_product.php">Đặt hàng Mỹ</a></li>
                    <?php }else{ ?>
                        <li><a href="orders_product.php">Đặt hàng Mỹ</a></li>
                    <?php } ?> 
                </ul>
                Địa chỉ: 5/103 Nơ Trang Long, Phường 7, Q. Bình Thạnh, Tp. Hồ Chí Minh. Điện thoại: (08)3510 2468. Hotline: 0939 333 277
                <br />
                Bản quyền thuộc về <a href="index.php" title="ushop.vn">ushop.vn</a> © 2011.
            </div>
            <div style="background:black;filter:alpha(opacity=7);-moz-opacity:0.2;-khtml-opacity: 0.2;opacity: 0.2;left:900px;position:absolute;bottom:34px;width: 100px; height: 44px;">
               
            </div>
            <?php $counter_query = tep_db_query("select * from counters where id=1");
$c= tep_db_fetch_array($counter_query);
$count=$c['counter']+1;



tep_db_query("update counters set counter = " . $count . " where id =1");
 ?>
            <div style="color:#fff;background: transparent;left:900px;position:absolute;bottom:34px;width: 100px; height: 48px;">
                <h4>Lượt truy cập</h4>
                <div><?php echo $c['counter'] ?></div>
            </div>
			
        </div>
    </div>
</div>

</body>
</html>